package com.ziytek.web.citizen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ziytek.web.citizen.configuration.db.DDS;
import com.ziytek.web.citizen.constant.DdsConstant;
import com.ziytek.web.citizen.pojo.basic.BasicStepSettings;

import java.util.List;

/**
 * @author fenghx
 * @version 1.0
 * @className BasicStepSettingsMapper
 * Description:
 * @date 2024/3/18 18:07
 */
public interface BasicStepSettingsMapper extends BaseMapper<BasicStepSettings> {
    /**
     * Description: 查询工步设置方案
     *
     * @param planNo   方案编号
     * @param isDelete 是否可用
     * @return StepSettingsTable
     */
    @DDS(DdsConstant.DS_BASIC)
    BasicStepSettings findFirstByPlanNoAndIsDeleteOrderByCreateTimeDesc(String planNo, int isDelete);


    /**
     * Description: 查询工步设置方案
     *
     * @param planName planName
     * @param isDelete 是否可用
     * @return StepSettingsTable
     */
    @DDS(DdsConstant.DS_BASIC)
    BasicStepSettings findFirstByPlanNameAndIsDeleteOrderByCreateTimeDesc(String planName, int isDelete);


    /**
     * Description: 查询工步设置方案
     *
     * @param id id
     * @return StepSettingsTable
     */
    @DDS(DdsConstant.DS_BASIC)
    BasicStepSettings findFirstById(Long id);

    /**
     * Description: 查询工步设置方案
     *
     * @param id       id
     * @param isDelete 是否可用
     * @return StepSettingsTable
     */
    @DDS(DdsConstant.DS_BASIC)
    BasicStepSettings findFirstByIdAndIsDelete(Long id, int isDelete);

    @DDS(DdsConstant.DS_BASIC)
    BasicStepSettings findFirstByIsDeleteOrderByCreateTimeAsc(int isDelete);

    /**
     * Description: 查询工步设置方案列表
     *
     * @param isDelete 是否可用
     * @return List<StepSettingsTable>
     */
    @DDS(DdsConstant.DS_BASIC)
    List<BasicStepSettings> findByIsDeleteOrderByCreateTimeAsc(int isDelete);

    /**
     * Description: 更新工步设置方案
     *
     * @param isDelete   是否可用
     * @param updateTime 更新时间
     * @param id         id
     */
    @DDS(DdsConstant.DS_BASIC)
    void settingsUpdate(int isDelete, long updateTime, long id);

    /**
     * Description: 更新工步设置方案
     *
     * @param stepSettingsTable 更新数据
     */
    @DDS(DdsConstant.DS_BASIC)
    void settingsAllUpdate(BasicStepSettings stepSettingsTable);

    /**
     * Description: 新增工步设置方案
     *
     * @param stepSettings 新增数据
     */
    @DDS(DdsConstant.DS_BASIC)
    void settingsSave(BasicStepSettings stepSettings);

    /**
     * Description: 查询id
     *
     * @return Long
     */
    @DDS(DdsConstant.DS_BASIC)
    Long queryMaxId();
}
